//
//  UIScrollView+SLSDK.m
//  SLSDK
//
//  Created by SongLian on 16/8/7.
//  Copyright © 2016年 SongLian. All rights reserved.
//

#import "UIScrollView+SLSDK.h"

@implementation UIScrollView (SLSDK)

- (CGFloat)sl_contentHeight {
    return self.contentSize.height;
}

- (void)setSl_contentHeight:(CGFloat)sl_contentHeight {
    CGSize contentSize = self.contentSize;
    contentSize.height = sl_contentHeight;
    self.contentSize = contentSize;
}

- (CGFloat)sl_contentWidth {
    return self.contentSize.width;
}

- (void)setSl_contentWidth:(CGFloat)sl_contentWidth {
    CGSize contentSize = self.contentSize;
    contentSize.width = sl_contentWidth;
    self.contentSize = contentSize;
}

+ (UIScrollView *)sl_scrollViewWithFrame:(CGRect)frame
                             contentSize:(CGSize)contentSize {
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:frame];
    scrollView.backgroundColor = [UIColor whiteColor];
    scrollView.contentSize = contentSize;
    return scrollView;
}

#ifdef MJRefreshing
- (void)sl_endMJRefreshing {
    [self.mj_header endRefreshing];
    [self.mj_footer endRefreshing];
}
#endif

@end
